import request from '@/router/axios';
import { baseUrl } from '@/config/env';

export const getMenu=(topMenuId)=>request({
    url: baseUrl + '/system/menu/left-menu',
    method: 'get',
    params: {
        topMenuId:topMenuId
    }
})

export const listMenu=(data)=>request({
    url: baseUrl + '/system/menu/list',
    method: 'get',
    params: data
})

export const userOwnedMenus=()=>request({
    url: baseUrl + '/system/menu/userOwnedMenus',
    method: 'get',
})

export const tenantOwnedMenus=()=>request({
    url: baseUrl + '/system/menu/tenantOwnedMenus',
    method: 'get',
})

export const selectMenuByTenantId=(tenantId)=>request({
    url: baseUrl + '/system/menu/'+tenantId,
    method: 'get'
})

export const addMenu=(data)=>request({
    url: baseUrl + '/system/menu',
    method: 'post',
    data:data
})


export const editMenu=(data)=>request({
    url: baseUrl + '/system/menu',
    method: 'put',
    data:data
})

export const delMenu=(menuId)=>request({
    url: baseUrl + '/system/menu/'+menuId,
    method: 'delete'
})

export const getAllHyperlinkMenu=()=>request({
    url: baseUrl + '/system/menu/getAllHyperlinkMenu',
    method: 'get',
})